count the number of occurrences of a character in a string in python